package cn.tedu._08securuty.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ResourceController {
    @GetMapping("/api/public/hello")
    public String HelloPublic(){
        return "public-success";
    }
    @GetMapping("/api/private/hello")
    @PreAuthorize("hasAuthority('sys:private:view')")
    public String HelloPrivate(){
        return "private-success";
    }
}
